﻿<UserControl
    x:Class="GoG.Client.Services.Popups.PopupWindowUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:popups1="using:GoG.Client.Services.Popups"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    x:Name="Root"
    Background="{StaticResource PopupBackgroundBrush}">
    
    <Grid Background="{Binding Background, ElementName=Root}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
    
        <Border Background="#2E2E2E"/>
        <TextBlock Grid.Row="0" 
                   Grid.Column="0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Margin="5,5"
                   FontSize="20"
                   Text="{Binding Title, ElementName=Root, FallbackValue='This is the title'}"
                   FontFamily="Segoe UI"
                   FontWeight="SemiBold"/>
        <Border x:Name="CloseBorder" 
                Height="40" 
                Width="40"
                HorizontalAlignment="Right"
                VerticalAlignment="Top"
                Grid.Row="0" 
                Grid.Column="1"
                Background="#BD0000"
                Padding="0"
                BorderThickness="0"
                PointerEntered="CloseBorder_OnPointerEntered"
                PointerExited="CloseBorder_OnPointerExited"
                PointerReleased="CloseBorder_OnPointerReleased"/>
        <TextBlock Foreground="White"
                   FontFamily="Segoe UI Symbol" 
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Grid.Row="0" 
                   Grid.Column="1"
                   IsHitTestVisible="False"
                   Text="❌"
                   FontSize="22"/>
        
        <!--Where the user control goes-->
        <ContentPresenter Grid.Row="1" 
                          Grid.Column="0"
                          Grid.ColumnSpan="2"
                          Margin="20"
                          Content="{Binding InnerControl, ElementName=Root}"/>
    </Grid>
</UserControl>
